import request from "@/utils/request";
// 充值相关

const tradeApi = {
	// 在线充值
	recharge(data : RechargeParams) {
		return request.post<dataResult>({ url: "/api/customer/pay/recharge", data });
	},
	// 充值列表
	getpaytradelist(data : GetpaytradelistParams) {
		return request.post<dataResult>({ url: "/api/customer/pay/gettradelist", data });
	},
	// 查询充值
	querypaytrade(data : QuerypaytradeParams) {
		return request.post<dataResult>({ url: "/api/customer/pay/querytrade", data, showLoading: false });
	},
	// 卡密充值
	cardrecharge(data : CardrechargeParams) {
		return request.post<dataResult>({ url: "/api/customer/pay/cardrecharge", data });
	}
};

export default tradeApi;

interface dataResult {
	data ?: any;
	message : string;
	status : number;
}

//在线充值
interface RechargeParams {
	type : string;
	amount : number;
}

//充值列表
interface GetpaytradelistParams {
	page : number;
	limit : number;
	status : number;
}

//查询充值
interface QuerypaytradeParams {
	out_trade_no : string;
}

//卡密充值
interface CardrechargeParams {
	card : string;
}